<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/12/11
 * Time: 0:09
 */

namespace Community\Controller;


use Think\Controller;

class WeixinController extends Controller
{
    public function test($ordid,$total_fee,$body){
        $config = [
            'appid' => "wx0a05f57632f25b1b",    /*微信开放平台上的应用id*/
            'mch_id' => "1294437601",   /*微信申请成功之后邮件中的商户id*/
            'api_key' => "d8326f877a462f3d3a21639a08835252",    /*在微信商户平台上自己设定的api密钥 32位*/
            'notify_url' => 'http://www.chinaola.com/ola/index.php/' /*自定义的回调程序地址id*/
        ];
        $s = new WxPayController($config);
        $content = [
            'body'=>$body,
            'out_trade_no'=>$ordid,
            'total_fee'=>$total_fee,
            'trade_type'=>'APP',
        ];
        $this->ajaxReturn($s->unifiedOrder($content));
    }
}